package org.bee.enums;

/**
 * 用户类型
 */
public enum UserType {

    SYSTEM(0, "系统用户"),

    COMMON(1, "普通用户");
    private Integer code;
    private String desc;

    UserType(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String getCodeMean(Integer code) {
        for (UserType userType : UserType.values()) {
            if (userType.getCode().equals(code)) {
                return userType.desc;
            }
        }
        return null;
    }
}
